package me.ereach.streams;

import java.util.List;

public class Main08UniqueElements {
    public static void main(String[] args) {
        List<Movie> movies = List.of(
                new Movie("a", 10),
                new Movie("a", 10),
                new Movie("b", 15),
                new Movie("c", 20)
        );

        System.out.println("===distinct based likes");
        movies.stream()
                .map(Movie::getLikes)
                .distinct()
                .forEach(System.out::println);

        System.out.println("===distinct base title");
        movies.stream()
                .map(Movie::getTitle)
                .distinct()
                .forEach(System.out::println);
    }
}
